<?php

namespace App\Http\Controllers;

use App\Model\Users;
use Illuminate\Http\Request;
use Tymon\JWTAuth\JWTAuth;
use Tymon\JWTAuth\Exceptions\JWTException;
use Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException;
class AuthenticateController extends Controller
{
    //
	protected $auth;
	public function __construct(JWTAuth $auth)
	{
			$this->auth=$auth;
	}

	public function authenticate(Request $request)
	{

//		$credentials = $this->validate($request, [
//			$this->username() => 'required|string',
//			'password' => 'required|string',
//		]);
		new Users();
		return $this->auth->fromUser();
	}
}
